﻿namespace Command_Pattern
{
    public abstract class Command
    {
        protected Barbecuer receiver;
        public int count;
        public string name;

        public Command(Barbecuer receiver)
        {
            this.receiver = (Barbecuer)receiver.Clone();
        }
        public void SetCount(int count)
        {
            this.count = count;
        }
        abstract public void Execute();

        public Object Clone()
        {
            Command clonedCommand = (Command)this.MemberwiseClone();
            if (this.receiver != null)
            {
                clonedCommand.receiver = (Barbecuer)this.receiver.Clone();
            }
            return clonedCommand;
        }

    }
}
